package sugarbind_input

class LigandController {

    def scaffold = true
	
	def findLigands = {

				println("params : " +params)
				
				def structure
				def ligands
				
				try
				{
					structure = Structure.get(params.structure)
				}
				catch(Exception ex)
				{
					println(ex.getMessage())
				}
			
				if(structure != null)
				{
					ligands = structure.ligands
				}
				else
				{
					ligands = Structure.listStructures()
				}
				render(template: 'ddlLigands', model:  [ligands : ligands])
			  }
}
